<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>__SITENAME__</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <link type="text/css" href="__DOMAINURL____WEBSITEDIR____BAOFENG__/css/public.css" rel="stylesheet" />
    <script src="__DOMAINURL____WEBSITEDIR____PLUGINS__/jQuery/jquery-2.2.3.min.js"></script>
    <script src="__DOMAINURL____WEBSITEDIR____BAOFENG__/js/public.js?v=80"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
            list-style: none;
            border: 0;
        }
        html {
            background-color: #fff;
            color: #333333;
            height:100%;
            font-size:12px;
            font-family: Arial,Helvetica,"微软雅黑","华文细黑",sans-serif;
        }
        em, i {
            font-style: normal;
        }
        button, input, optgroup, option, select, textarea {
            font-family: inherit;
            font-size: inherit;
            font-style: inherit;
            font-weight: inherit;
            outline: 0;
        }
        a, button, input {
            -webkit-tap-highlight-color: rgba(255,0,0,0);
        }
        p {
            margin:0px;
            padding:0px;
        }
        .boxflex > * {
            display: block;
        }
        .box_flex_1 {
            -moz-box-flex: 1;
            box-flex: 1;
            -moz-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            -webkit-box-flex: 1;
        }
        .android_activity {
            height:100%;
        }
        .register-box {
            width: 100%;
            min-height: 100%;
            background-color: #fff;
            padding: 20px 10px;
            box-sizing: border-box;
        }
        .boxflex {
            display: box !important;
            display: -moz-box !important;
            display: -o-box !important;
            display: -ms-box !important;
            display: -webkit-flex !important;
            display: -moz-flex !important;
            display: -o-flex !important;
            display: flex !important;
            display: -webkit-box !important;
        }
        .input-wrap {
            height: 40px;
            border: 1px solid #e6e6e6;
            border-radius: 4px;
            margin-bottom: 15px;
        }
        .input-wrap input {
            height: 100%;
            line-height: 40px\9;
            padding: 0 10px;
            width: 100%;
            box-sizing: border-box;
        }
        i.icon {
            display: inline-block;
            width: 40px;
            height: 40px;
            margin-top:0px;
            background: url(__DOMAINURL____WEBSITEDIR____BAOFENG__/img/icon2.png) no-repeat;
            background-size: 100%;
        }
        i.icon.icon-tel {
            background-position: -33px -4px;
            background-size: 450%;
        }
        i.icon.icon-name {
            background-position: 0 -4px;
            background-size: 450%;
        }
        i.icon.icon-pwd {
            background-position: -102px -4px;
            background-size: 450%;
        }
        .input-wrap i.icon {
            background-color: #dcdcdc;
        }

        #errorMsg {
            padding: 10px 0;
            line-height: 30px;
            height: 30px;
            color: #d82f2f;
        }
        .yebz_but {
            height: 40px;
            line-height: 40px;
            border: 0;
            background-color: #58abeb;
            font-size: 13px;
            width:100%;
            color: #FFF;
            cursor:pointer;
            border-radius: 4px;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            -ms-border-radius: 4px;
            -o-border-radius: 4px;
            text-align: center;
            display: block;
        }
        .yebz_but {
            margin-top: 5px;
        }
        .yebz_but.disable {
            background-color: #ccc;
            cursor: not-allowed;
        }
    </style>
</head>
<body>
<div class="android_activity">
    <div class="register-box">
        <div class="input-wrap boxflex">
            <i class="icon icon-tel"></i>
            <input type="tel" value="{$user.mobile_phone}" placeholder="请输入您的手机号码" readonly="" maxlength="11" class="box_flex_1 register-tel">
        </div>
        <div class="input-wrap boxflex">
            <i class="icon icon-name"></i>
            <input type="hidden" value="{$user.audit_state}" id="audit_state">
            <input type="text" placeholder="请输入您的真实姓名" maxlength="16" value="{$user.name}" class="box_flex_1" id="relName">
        </div>
        <div class="input-wrap boxflex"><i class="icon icon-pwd"></i><input type="text" id="orgcode" placeholder="请输入微会员编号" maxlength="18" class="box_flex_1"></div>
        <p id="errorMsg"></p>

        <if condition="$user['audit_state'] eq 0">
            <button id="yebz_but" class="yebz_but">提交</button>
            <elseif condition="$user['audit_state'] eq 2" />
            <button id="yebz_but" class="yebz_but disable" disabled>申请已提交，等待审核</button>
            <else/>
            <button id="yebz_but" class="yebz_but">申请已驳回，请重新提交申请</button>
        </if>

    </div>
</div>
<script>
    var isSub = true;
    $(function () {
       $("#yebz_but").on('click', function () {
           $("#errorMsg").html("");
           if ($("#relName").val() == "") {
               $("#errorMsg").html("请输入你的真实姓名");
               return;
           }

           if (isSub == true) {
               isSub = false;
               loadshow();
               $("#yebz_but").addClass("disable");
               $.post("subApplyBroker", { relName:$("#relName").val(), orgcode:$("#orgcode").val(), audit_state:$("#audit_state").val() }, function(result) {
                   $("#yebz_but").removeClass("disable");
                   loadhide();
                   // isSub = true;
                   window.location.reload();
               });
           }
       });
    });
</script>
</body>
</html>